﻿using System;
using System.Text;

namespace Boco.Digg.Service
{
	public class FluentStoryMethod : IStoryMethod
	{
		IStoryStatus _status;
		IArguments _arguments;

		public IStoryStatus Status<T>() where T : StatusBase
		{
			_arguments = new Arguments();
			_status = Activator.CreateInstance(typeof (T), _arguments) as IStoryStatus;

			return _status;
		}

		public override string ToString()
		{
			StringBuilder builder = new StringBuilder();

			builder.Append("stories");
			builder.Append("/");
			builder.Append(_status.ToString());
			builder.Append(_arguments.ToString());

			return builder.ToString();
		}
	}
}
